package com.moyun.zbmy.zizhou.ui.adapter.holder;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.moyun.zbmy.zizhou.R;
import com.moyun.zbmy.zizhou.ui.util.IListShowData;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 新直播模块中的电视、广播入口
 */
public class LiveTvEntryHolder extends BaseAbsHolder<IListShowData> {

    @BindView(R.id.item_tv)
    protected RelativeLayout item_tv;
    @BindView(R.id.item_fm)
    protected RelativeLayout item_fm;
    @BindView(R.id.item_edu)
    protected RelativeLayout item_edu;

    private  OnTvSelectListener listener;


    public LiveTvEntryHolder(Context context, View itemView,  OnTvSelectListener listener) {
        super(context, itemView);
        this.listener = listener;
    }

    @Override
    protected void initInject() {
        ButterKnife.bind(this, itemView);
    }

    @Override
    public void setData(IListShowData iListShowData) {
        item_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                listener.OnTvSelect(0);
            }
        });

        item_fm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                listener.OnTvSelect(1);
            }
        });
        item_edu.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                listener.OnTvSelect(2);
            }
        });


    }


    public interface OnTvSelectListener{
        void OnTvSelect(int pos);
    }

}
